<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>钓鱼邮件检测</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f9;
            color: #333;
        }

        header {
            background-color: #2e3b4e;
            color: white;
            padding: 20px 0;
            text-align: center;
        }

        h1 {
            font-size: 2.5rem;
            margin: 0;
        }

        .container {
            width: 80%;
            margin: 30px auto;
            padding: 20px;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        textarea {
            width: 100%;
            padding: 12px;
            font-size: 1rem;
            border: 1px solid #ddd;
            border-radius: 8px;
            margin: 10px 0;
            resize: vertical;
        }

        button {
            background-color: #4CAF50;
            color: white;
            font-size: 1.1rem;
            padding: 12px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        button:hover {
            background-color: #45a049;
        }

        .instructions {
            font-size: 1.2rem;
            color: #555;
            margin-top: 20px;
            padding: 15px;
            background-color: #f9f9f9;
            border-left: 5px solid #4CAF50;
        }

        .log-container {
            margin-top: 40px;
            padding-top: 20px;
            border-top: 1px solid #ddd;
        }

        .log-heading {
            font-size: 1.5rem;
            margin-bottom: 15px;
            color: #2e3b4e;
        }

        .log-content {
            height: 300px;
            overflow-y: auto;
            background-color: #f5f5f5;
            padding: 15px;
            border-radius: 5px;
            font-family: monospace;
            font-size: 0.9rem;
            white-space: pre-wrap;
            text-align: left;
            border: 1px solid #ddd;
        }

        .section-divider {
            height: 1px;
            background-color: #ddd;
            margin: 30px 0;
        }

        .nav-links {
            text-align: center;
            margin: 20px 0;
        }

        .nav-link {
            display: inline-block;
            margin: 0 10px;
            padding: 10px 15px;
            background-color: #3498db;
            color: white;
            text-decoration: none;
            border-radius: 5px;
            transition: background-color 0.3s;
        }

        .nav-link:hover {
            background-color: #2980b9;
        }

        footer {
            text-align: center;
            font-size: 0.9rem;
            padding: 15px;
            background-color: #2e3b4e;
            color: white;
            margin-top: 30px;
        }
    </style>
</head>
<body>

<header>
    <h1>钓鱼邮件检测</h1>
</header>

<div class="container">
    <div class="nav-links">
        <a href="/" class="nav-link">首页</a>
        <a href="/visualize" class="nav-link">查看模型性能</a>
    </div>
    
    <h2>输入邮件内容</h2>
    <p class="instructions">要检查邮件是否为钓鱼邮件，请在下方粘贴邮件内容并点击"预测"按钮。</p>
    <form action="/predict" method="POST">
        <textarea name="email_content" rows="10" placeholder="在此处输入邮件内容..."></textarea><br>
        <button type="submit">预测</button>
    </form>

    <div class="log-container">
        <h3 class="log-heading">预测历史记录</h3>
        <div class="log-content">{{ log_content }}</div>
    </div>
</div>

<footer>
    <p>&copy; 2025 钓鱼邮件检测系统. 保留所有权利.</p>
</footer>

</body>
</html>